﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// 业务逻辑类PaperIP 的摘要说明。
    /// </summary>
    public partial class PeerReviewIP
    {
        /// <summary>
        /// Dal定义的便利
        /// </summary>
        private readonly ElingOA6_Admin_DSJCJ.DAL.PeerReviewIP dal = new ElingOA6_Admin_DSJCJ.DAL.PeerReviewIP();


        /// <summary>
        /// 根据编号得到数据
        /// </summary>
        /// <param name="paperID">编号</param>
        /// <returns>集合</returns>
        public List<Model.PeerReviewIP> GetListPeerReviewIP(decimal peerReviewID)
        {
            DataSet ds = dal.GetListPeerReviewIP(peerReviewID);
            List<Model.PeerReviewIP> modelList = new List<Model.PeerReviewIP>();
            DataTable dt = ds.Tables[0];
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Model.PeerReviewIP model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Model.PeerReviewIP();
                    if (dt.Rows[n]["FProp"] != null)
                    {
                        model.FProp = dt.Rows[n]["FProp"].ToString();
                    }
                    if (dt.Rows[n]["FPeerReviewID"] != null && dt.Rows[n]["FPeerReviewID"].ToString() != "")
                    {
                        model.FPeerReviewID = decimal.Parse(dt.Rows[n]["FPeerReviewID"].ToString());
                    }
                    if (dt.Rows[n]["FIPGroupID"] != null && dt.Rows[n]["FIPGroupID"].ToString() != "")
                    {
                        model.FIPGroupID = int.Parse(dt.Rows[n]["FIPGroupID"].ToString());
                    }
                    modelList.Add(model);
                }
            }


            return modelList;
        }

    }
}
